Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(v2): allow navbar links to show active style by specifying a base path #2299

Merged
merged 1 commit into from
Feb 20, 2020

Conversation

yangshun
Copy link
Contributor

Motivation

Attempts to fix #2222 and as an alternative to #2243. I think this solution is better than in #2243 as it is a general solution and can be useful for other kinds of pages as well.

If approved, I'll add docs for this feature and add this new property to the templates.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Click on docs links in preview.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@yangshun yangshun removed the request for review from wgao19 February 19, 2020 16:36
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 19, 2020
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit 1c1fd31

https://deploy-preview-2299--docusaurus-2.netlify.com

Copy link
Contributor

@lex111 lex111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, I approve, although I do not really like this approach, since users need to manually add new option themselves in order to achieve the desired behavior. When as they rather expected it to work out of the box without manual editing at all.

@yangshun
Copy link
Contributor Author

since users need to manually add new option themselves in order to achieve the desired behavior.

Yes, but this is much more flexible and keeps the generic components generic, which is better for long term maintainability.

@yangshun yangshun merged commit c46bf90 into master Feb 20, 2020
@yangshun yangshun deleted the docs-active branch February 20, 2020 11:21
@yangshun yangshun changed the title feat(v2): allow navbar links to show active style by specifiying a base path feat(v2): allow navbar links to show active style by specifying a base path Feb 21, 2020
@yangshun yangshun added the feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. label Feb 21, 2020
@lex111 lex111 added this to the v2.0.0-alpha.44 milestone Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Active link in navbar loses highlight when you click on sidebar items (v2 only)
4 participants